package com.usian.admin.feign;

import com.usian.model.article.pojos.ApArticle;
import com.usian.model.article.pojos.ApArticleConfig;
import com.usian.model.article.pojos.ApArticleContent;
import com.usian.model.article.pojos.ApAuthor;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;

@FeignClient("leadnews-article")
public interface ArticleFeign {

    @RequestMapping("/api/v1/article/saveApArticle")
    public ApArticle saveApArticle(@RequestBody ApArticle apArticle);

    @RequestMapping("/api/v1/article_content/save")
    public ApArticleContent saveApArticleContent(@RequestBody ApArticleContent apArticleContent);

    @RequestMapping("/api/v1/article_config/save")
    public ApArticleConfig saveApArticleConfig(@RequestBody ApArticleConfig apArticleConfig);

    @GetMapping("/api/v1/author/findByName/{name}")
    public ApAuthor findByName(@PathVariable String name);

    @GetMapping("/api/v1/author/findByWmUserId/{id}")
    public ApAuthor findByWmUserId(@PathVariable("id") Integer id);
}
